<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
  <button id="btn">发送</button>

  <script src="./jquery-3.6.0/jQuery3.6.js"></script>
  <script type="text/javascript">
    // $.ajax({
    //   method: 'get',
    //   url: 'http://ajax.frontend.itheima.net:3006/api/jsonp',
    //   data: {
    //     name: 'zs',
    //     age: 20
    //   },
    //   success: function(res){
    //     console.log(res);
    //   }
    // })


    function success(data){
      console.log(data);
      console.log("拿到了Data数据");
    }
  </script>
  <!-- <script src="./js/getdata.js?callback=success"></script> -->
  <script src="http://ajax.frontend.itheima.net:3006/api/jsonp?callback=success&name=ls&age=39"></script>

  <script>
    $(function(){
        $.ajax({
          url: "http://ajax.frontend.itheima.net:3006/api/jsonp?name=ls&age=28",
          dataType: 'jsonp',
          jsonp: 'cb',
          jsonpCallback: 'abc',
          success: function(res){
            console.log(res);
          }
        })
      })

      $('#btn').click(function(){
        $.ajax({
          url: "http://ajax.frontend.itheima.net:3006/api/jsonp?name=ls&age=28",
          dataType: 'jsonp',
          jsonp: 'cb',
          jsonpCallback: 'abc',
          success: function(res){
            console.log(res);
          }
        })
      })
  </script>
</body>
</html>